import { App, Provide,IMidwayApplication, Inject } from '@midwayjs/core';
import {
  BaseRpcService,
  CoolRpc
} from '@cool-midway/rpc';
import { browserDto } from '../dto/browserDto';

@Provide()
export class browserService extends BaseRpcService {
  @App()
  app: IMidwayApplication;

  @Inject()
  rpc: CoolRpc;

  /**
   * 远程调用
   * @returns
   */
  async call(rpc: browserDto) {
    const { name, service,method, params } = rpc;
    return  await this.rpc.call(  name, service,method, params);
  }

}